package com.atlin.cli.command;

import cn.hutool.core.util.ReflectUtil;
import com.atlin.model.DataModel;
import picocli.CommandLine;

import java.lang.reflect.Field;

/**
 * @author atlin
 * @description 查看参数信息
 * @createDate 2024/9/23 9:54
 */
@CommandLine.Command(name = "config", description = "查看参数信息", mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable {
    @Override
    public void run() {
        System.out.println("查看参数信息");

        //原生
//        Class<MainTemplateConfig> configClass = MainTemplateConfig.class;
//        Field[] fields = configClass.getDeclaredFields();

        // hutool
        Field[] fields = ReflectUtil.getFields(DataModel.class);

        for (Field field : fields) {
            System.out.println("字段名称：" + field.getName() + "\t字段类型：" + field.getType());
        }
    }

}
